//
//  TableKeys.swift
//  Weibo_SwiftDemo
//
//  Created by gjh on 2020/12/14.
//

import Foundation

public struct TableKeys {
    static let Section = "section"
    static let Rows = "rows"
    static let ImageName = "imageName"
    static let Title = "title"
    static let SubTitle = "subTitle"
    static let seeMore = "See More..."
    static let addFavorites = "Add Favorites..."
    static let logout = "Log Out"
  
    static func populate(withUser user: FBMeUser) -> [[String: Any]] {
        return [
            [
                TableKeys.Rows: [
                    [TableKeys.ImageName: user.avatarName, TableKeys.Title: user.name, TableKeys.SubTitle: "View your profile"]
                ]
            ],
            [
                TableKeys.Rows: [
                    [TableKeys.ImageName: Spec.imageName.friends, TableKeys.Title: "Friends"],
                    [TableKeys.ImageName: Spec.imageName.events, TableKeys.Title: "Events"],
                    [TableKeys.ImageName: Spec.imageName.groups, TableKeys.Title: "Groups"],
                    [TableKeys.ImageName: Spec.imageName.education, TableKeys.Title: user.education],
                    [TableKeys.ImageName: Spec.imageName.townHall, TableKeys.Title: "Town Hall"],
                    [TableKeys.ImageName: Spec.imageName.instantGames, TableKeys.Title: "Instant Games"],
                    [TableKeys.Title: TableKeys.seeMore]
                ]
            ],
            [
                TableKeys.Section: "FAVORITES",
                TableKeys.Rows: [
                    [TableKeys.Title: TableKeys.addFavorites]
                ]
            ],
            [
                TableKeys.Rows: [
                    [TableKeys.ImageName: Spec.imageName.settings, TableKeys.Title: "Settings"],
                    [TableKeys.ImageName: Spec.imageName.privacyShortcuts, TableKeys.Title: "Privacy Shortcuts"],
                    [TableKeys.ImageName: Spec.imageName.helpSupport, TableKeys.Title: "Help and Support"]
                ]
            ],
            [
                TableKeys.Rows: [
                    [TableKeys.Title: TableKeys.logout]
                ]
            ]
        ]
    }
}
